package decoder

import (
	"pmservice/ecgpacket"
)

type ProtocolType int

const (
	PROTOCOL_MLLP ProtocolType = iota
)

// 解码数据，需要完整数据包
type Decoder interface {
	Decode(dat []byte) []*ecgpacket.Packet
}

func NewDecode(protocol ProtocolType) Decoder {
	switch protocol {
	case PROTOCOL_MLLP:
		return NewHL7Decoder()
	default:
		return nil
	}
}
